import request from '@/utils/request'

/**
 * 字典
 */
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'POST',
    data: { dictCode }
  })
}

export function queryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/breakthroughActivity/queryPage',
    method: 'post',
    data
  })
}

/**
 * 查询详情
 * @param {*} id
 */
export function get(id) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/breakthroughActivity/get',
    method: 'get',
    params: { id }
  })
}

/**
 * 添加
 * @param {*} data
 */
export function insert(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/breakthroughActivity/insert',
    method: 'post',
    data
  })
}

/**
 * 编辑
 * @param {*} data
 */
export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/breakthroughActivity/update',
    method: 'post',
    data
  })
}

/**
 * 删除
 * @param {*} id
 */
export function del(ids) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/breakthroughActivity/deleteByIds',
    method: 'get',
    params: { ids }
  })
}

/**
 * 闯关列表查询
 * @param {*} data
 */
export function queryRush(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/rushQuestions/query',
    method: 'post',
    data
  })
}

/**
 * 闯关排行
 * @param {*} data
 */
export function queryRushRank(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/rushQuestions/queryPageRankingList',
    method: 'post',
    data
  })
}
/**
 * 对战排行
 * @param {*} data
 */
export function queryPagePkRanking(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/pkRecord/queryPagePkRanking',
    method: 'post',
    data
  })
}
/**
 * 导出统计--脱敏
 */
export function exportMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/rushQuestions/exportCertificationRankMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}
/**
 * 导出统计--不脱敏
 */
export function exportNoMask(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/rushQuestions/exportCertificationRankNoMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}

